{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 1. Calico Document Tools and Bibtex" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook describes an alternative Bibtex tool that differs from other Jupyter/IPython extensions:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1. https://github.com/takluyver/cite2c\n", "2. http://nbviewer.ipython.org/github/HHammond/nbconvert-examples/blob/master/citations/Tutorial.ipynb\n", "3. http://nbviewer.ipython.org/gist/z-m-k/6080008/ipyBibtex.ipynb\n", "\n", "The main differences:\n", "\n", "* Uses standard Markdown to represent citations and references\n", "* Can keep the bibtex entries (the database) **inside** the notebook\n", "* Optionally can use a Bibliography.ipynb in folder (or in a parent folder)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#Table of Contents\n", "* [1. Calico Document Tools and Bibtex](#1.-Calico-Document-Tools-and-Bibtex)\n", "\t* [1.1 Installation](#1.1-Installation)\n", "\t* [1.2 Adding a Bibtex Database to the Notebook](#1.2-Adding-a-Bibtex-Database-to-the-Notebook)\n", "\t* [1.3 Example Use](#1.3-Example-Use)\n", "\t* [1.4 Further Information](#1.4-Further-Information)\n", "\t* [1.5 Future work and Limitations](#1.5-Future-work-and-Limitations)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.1 Installation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```bash\n", "sudo ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "At some point after installing, you need to load the nbextension:\n", "\n", "```javascript\n", "IPython.load_extensions('calico-document-tools');\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "That will add the \"Generate References\" button (and others as well---see Futher Information below)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.2 Adding a Bibtex Database to the Notebook" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, one can include Bibtex entries any where in a notebook. I put them at the end.\n", "\n", "The Bibtex database is in a Markdown cell, as a HTML-comment (with \"bibtex\") marked as follows:\n", "\n", "```html\n", "\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, you can reference the Bibtex item in Markdown cells using this format:\n", "\n", "
\n",
    "[cite](#cite-BIBTEX_LABEL)\n",
    "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "where `BIBTEX_LABEL` would be something like `PER-GRA:2007`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.3 Example Use" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You would write:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n",
    "Thus, if you want to cite IPython, then you could use that \n",
    "citation [cite](#cite-PER-GRA:2007)\n",
    "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "That won't look like a real citation until you render the References by pressing the \"Generate References\" button. It then becomes:\n", "\n", "
\n",
    "Thus, if you want to cite IPython, then you could use that \n",
    "citation <a name=\"ref-1\"/>[(Pérez and Granger, 2007)](#cite-PER-GRA:2007)\n",
    "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It will automatically do the following:\n", "\n", "* The citation will be replaced with the proper text\n", "* A **Reference** section will be added at the end of the notebook\n", "* Links will be generated that:\n", " * take you to the citation to the **Reference**\n", " * take you from the **Reference** to the citation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here is the real markdown:\n", "\n", "Thus, if you want to cite IPython, then you could use that citation [(Pérez and Granger, 2007)](#cite-PER-GRA:2007)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Optional Bibliography.ipynb\n", "\n", "In addition to having the bibliography information stored directly in a notebook (which is highly preferred for reproducible research) you can also create a Bibliography.ipynb in this directory, or a parent directory. See below for further information." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.4 Further Information" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* https://www.youtube.com/watch?v=86FTd1pcoZ4 - video demo of this notebook\n", "* http://jupyter.cs.brynmawr.edu/hub/dblank/public/Jupyter%20Notebook%20Users%20Manual.ipynb#5.-Bibliographic-Support\n", "* https://www.youtube.com/watch?v=LRzUSilYEks - Calico Document Tools installation video\n", "* https://www.youtube.com/watch?v=YbM8rrj-Bms - Calico Document Tools demonstration (other tools)\n", "* http://calicoproject.org/ICalico - documentation\n", "* http://jupyter.cs.brynmawr.edu/hub/dblank/public//Examples/Calico%20Document%20Tools%20and%20Bibtex.ipynb - static version of this notebook" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.5 Future work and Limitations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* Reference formatting is not complete; approximates MLA style\n", "* need to explore using https://bitbucket.org/fbennett/citeproc-js/wiki/Home to generate different citation styles" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#References\n", "\n", "[^](#ref-1) Pérez, Fernando and Granger, Brian E.. 2007. _IPython: a System for Interactive Scientific Computing_.\n", "\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.0" } }, "nbformat": 4, "nbformat_minor": 0 }